/**
 * Created by Jacky.Gao on 2017-01-25.
 */
import Tool from './Tool.js';
import { undoManager } from '../Utils.js';
import { alert } from '../MsgBox.js';

export default class RedoTool extends Tool {
  execute() {
    if (undoManager.hasRedo()) {
      undoManager.redo();
    } else {
      alert(`${window.i18n.tools.redo.noRedo}`);
    }
  }
  getTitle() {
    return `${window.i18n.tools.redo.redo}`;
  }
  getIcon() {
    return `<div class="btn-group"><button type="button" class="btn btn-default"
    style="border:none;border-radius:0;text-align: center;padding:0;"><i class="icon-ym icon-ym-report-icon-restore"></i></button></div>`;
  }
}